#pragma once

#include "export.h"
#include <osgGA/TrackballManipulator>
#include <osg/Quat>

class DefaultManipulator : public osgGA::TrackballManipulator
{

public:
    DefaultManipulator() {_allow_throw = false;};
    void computePosition(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
    bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);

    void home(double /*currentTime*/);
    void setNode(osg::Node* node) {_node=node;};
    void SetAllowThrow(bool b) {_allow_throw=b;};
    bool GetAllowThrow()       {return _allow_throw;};

protected:
  osg::ref_ptr<osg::Node> _node;
  bool _allow_throw;
};
